package final_;

import java.util.Random;

public class StaticFinalTest {
    static Random r = new Random();
    final int k = r.nextInt(10);
    static final int k2 = r.nextInt(10);  // static final的字段的值在类的初始化阶段就固定了，不随对象变化

    public static void main(String[] args) {

        StaticFinalTest t1 = new StaticFinalTest();
        System.out.println("k=" + t1.k + " k2=" + t1.k2);
        StaticFinalTest t2 = new StaticFinalTest();
        System.out.println("k=" + t2.k + " k2=" + t2.k2);
    }
}
